// ------- 奖品名称滚动动画 -------
function autoScroll() {
    // 奖品名称溢出滚动
    var str = '',
        width = '';
    style = document.createElement('style');
    style.setAttribute('rel', 'stylesheet');
    var gift = $('.what');
    for (var i = 0; i < gift.length; i++) {
        if ($(gift[i]).children('span').width() > $('.what').width()) {
            width = $(gift[i]).children('span').width();
            wrapperWidth = $(gift[i]).width();
            // str += '@keyframes scroll' + i + '{0% {color: red;left: 0;}50% {' + 'color: yellowgreen;' + 'left: -' + (width / (2 * wrapperWidth)) * 100 + '%;}100% {color: blue;left: -' + (width / wrapperWidth) * 100 + '%;}}';
            str += '@keyframes scroll' + i + '{ from {color: red;transform:translate(1.5rem)} to {color: #1E9FFF;transform:translate(-' + (width / wrapperWidth+0.4) * 100 + '%);}}';
            style.innerHTML = str;
            $('head').append(style);
            $(gift[i]).children('span').css({
                'position': 'absolute',
                'animation': '15s scroll' + i + ' linear infinite normal',
                'padding-left': '0.1rem'
            });
        }
    }
}